package com.cici.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.cici.entities.Dept;
/**
 * 因为feign是一个声明式WebService客户端,
 * 所以这个接口里面声明的方法应该是服务端（provider）中service中的方法。
 * @author cici
 *
 */
@FeignClient(value = "MICROSERVICECLOUD-DEPT1",fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {
	
	//映射地址就是对应的provider中controller层中访问地址
	
	@RequestMapping(value = "/dept/add",method = RequestMethod.POST)
	public boolean add(Dept dept);
	
	@RequestMapping(value = "/dept/get/{id}",method = RequestMethod.GET)
	public Dept    get(Long id);
	
	@RequestMapping(value = "/dept/list",method = RequestMethod.GET)
	public List<Dept> list();
}
